<template>
	<view class="cloummStart">
		<view class=" defultBackground">
			<appBar title="实名认证" :right-icon="'search'" :showRight="true" @rightClick="search"></appBar>
			<uvDropdown :order="orderObj" :resultMenu="resultMenu" :defaultValue="defaultValue">
				<view class="rowStart gap10">
					<uv-icon name="search"></uv-icon>搜索
				</view>
			</uvDropdown>
		</view>
		<view class="w100">
			<RefashList ref="paging" :apiCallback="fetchData">
				<template #default="{ dataList }">
					<view class="w100 pall20">
						<view v-for="(item,index) in dataList" :key="index" @click="gotoPage(`/pages/tabbar/work/pages/realInfo/realInfo?id=${index}`)">
							<realItem></realItem>
						</view>
					</view>
					
				</template>
			</RefashList>
		</view>
	</view>

</template>
<script>
	import uvDropdown from "@/components/uvDropdown/uvDropdown.vue";
	import calendarBtnVue from "@/components/calendarBtn/calendarBtn.vue";
	import RefashList from "@/components/RefashList/RefashList.vue";
	import realItem from "./realItem.vue";
	export default {
		components: {
			uvDropdown,
			calendarBtnVue,
			RefashList,
			realItem
		},
		data() {
			return {
				orderObj: {
					wechatStatus: {
						label: "微信状态",
						value: "all",
						activeIndex: 0,
						color: "#333",
						activeColor: "#fb5f46",
						child: [{
								label: "全部状态",
								value: "all",
							},
							{
								label: "待提交",
								value: "wait",
							},
							{
								label: "已提交",
								value: "submit",
							},
							{
								label: "审核中",
								value: "audit",
							},
							{
								label: "待联系人确认",
								value: "confirm",
							},
							{
								label: "待认证",
								value: "waitAuth",
							},
							{
								label: "待授权",
								value: "waitAuth",
							},
							{
								label: "审核驳回",
								value: "refuse",
							},
							{
								label: "认证通过",
								value: "pass",
							},
						],
					},
					zfbStatus: {
						label: "支付宝状态",
						value: "all",
						activeIndex: 0,
						color: "#333",
						activeColor: "#fb5f46",
						child: [{
								label: "全部状态",
								value: "all",
							},
							{
								label: "待提交",
								value: "wait",
							},
							{
								label: "待联系人确认",
								value: "concatConfirm",
							},
							{
								label: "待法人确认",
								value: "legalConfirm",
							},
							{
								label: "审核中",
								value: "audit",
							},
							{
								label: "待授权",
								value: "waitAuth",
							},
							{
								label: "审核驳回",
								value: "refuse",
							},
							{
								label: "认证通过",
								value: "pass",
							},
						],
					},
				},
				resultMenu: [{
						name: "wechatStatus",
						label: "微信状态",
						value: "wx",
					},
					{
						name: "zfbStatus",
						label: "支付宝状态",
						value: "zfb",
					},
				],
				defaultValue: [0, "all", "0"],
			};
		},

		methods: {
			// 获取下拉框项的label和value
			dropItem(name) {
				const find = this.resultMenu.find((item) => item.name === name);
				if (find) {
					return {
						label: find.label,
						value: find.value,
					};
				} else {
					return {
						label: this[name].label,
						value: this[name].value,
					};
				}
			},
			search() {
				uni.navigateTo({
					url: "/pages/tabbar/home/homeSearch/homeSearch",
				});
			},
			async fetchData({
				pageNo,
				pageSize,
				type
			}) {
				const params = {
					pageNo: pageNo,
					pageSize: pageSize,
					type: type,
				};

				const list = [{
						"title": "1",
						"detail": "测试信息1"
					},
					{
						"title": "2",
						"detail": "测试信息1"
					},
					{
						"title": "3",
						"detail": "测试信息1"
					},
					{
						"title": "4",
						"detail": "测试信息1"
					},
					{
						"title": "5",
						"detail": "测试信息1"
					},
					{
						"title": "6",
						"detail": "测试信息1"
					},
					{
						"title": "7",
						"detail": "测试信息1"
					},
					{
						"title": "8",
						"detail": "测试信息1"
					},
					{
						"title": "9",
						"detail": "测试信息1"
					},
					{
						"title": "10",
						"detail": "测试信息1"
					}
				]
				return {
					data: {
						list: list,
						pages: list.length,
					},
				};
			},

		},
	};
</script>